home *** CD-ROM | disk | FTP | other *** search
- IntControl (35, 500, 0, 0, 0)
- bOK = @TRUE
- szDial = "<dialupname>"
- szPgmPath = "<pgmpath>"
- szPgmDir = "<pgmdir>"
- bGetMail = <getmail>
- bSendMail = <sendmail>
- bEmpty = <empty>
- bCompact = <compact>
- szErrDesc = ""
-
-
- ;Dial our host (unless user is on a direct connect)...
- hConn = 0
- if ((bGetMail || bSendMail) && szDial <> "")
- hConn = SDialUp (szDial)
- if (!hConn)
- nErr = SGetLastErr ()
- switch nErr
- case @SErrNotFound
- szErrDesc = "Couldn't connect to %szDial% - no such dial-up"
-
- case nErr ; <--default
- szErrDesc = "Couldn't connect to %szDial% - error %nErr%"
- endswitch
- bOK = @FALSE
- goto LogIt
- endif
- endif
-
-
- ;Activate or Run Eudora...
- If WinExist("Eudora")
- WinActivate("Eudora")
- else
- DirChange (szPgmDir)
- Run(szPgmPath, "")
- endif
-
-
- ; Do stuff online...
- :GetMail
- if bGetMail
- SendKeysTo("Eudora", "!FM")
- while !WinExist("No New Mail") && !WinExist("New Mail!")
- Delay(5)
- endwhile
- Delay(1)
- SendKeysTo("Eudora", "~")
- endif
-
-
- :SendMail
- if bSendMail
- SendKeysTo("Eudora", "!FQ")
- while WinExist("Progress")
- Delay(5)
- endwhile
- Delay(1)
- endif
-
-
- ; Do stuff offline...
- :Compact
- if bCompact
- SendKeysTo("Eudora", "!ST")
- while WinExist("Progress")
- Delay(5)
- endwhile
- Delay(1)
- endif
-
-
- :Empty
- if bEmpty
- SendKeysTo("Eudora", "!SE")
- while WinExist("Progress")
- Delay(5)
- endwhile
- Delay(1)
- endif
-
-
- ; If user hit Ctrl+Break, WIL will bring us here...
- :Cancel
-
- ; Hang up...
- :HangUp
- if (hConn)
- nRet = SHangUp (hConn)
- endif
-
-
- ; Log what we did...
- :LogIt
- if bOK == @TRUE
- szLog = "Ran Eudora"
- else
- szLog = strcat ("Error automating Eudora:", @CRLF, szErrDesc)
- endif
-
- CMLogMessage (szLog)
- exit
-
- ~
-